from gettext import textdomain, gettext as _
from pylons import c



def get_form_style(field):
    if isError(field):
        return 'background-color: yellow;'
    return ''

def isError(field):
    try:
        for key, val in c.errors.iteritems():
            if key == field:
                return True
    except:
        return False
    return False
    
def getError(field):
    try:
        return c.errors[field]
    except:
        pass
    return ''
    